package cn.com.api.mapper.base;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.ApiU_dynamic_rule;

//DAO
public interface U_dynamic_ruleMapperBase {

	// 根据id查看
	@Select("SELECT * FROM U_DYNAMIC_RULE  WHERE ID = #{id}")
	public ApiU_dynamic_rule findU_dynamic_ruleById(Integer id);

	// 查看数据集
	@Select("SELECT * FROM U_dynamic_rule")
	public List<ApiU_dynamic_rule> findU_dynamic_rules();

	// 根据条件查看数据集
	public List<Map<String, Object>> findU_dynamic_rulesByMap(HashMap condition);

	// 添加
	@Insert("INSERT INTO U_DYNAMIC_RULE (USER_ID, TO_UID, ADD_TIME, IS_CANCEL) VALUES (#{user_id}, #{to_uid}, #{add_time}, #{is_cancel})")
	@Options(useGeneratedKeys = true, keyProperty = "id")
	public int insertU_dynamic_rule(ApiU_dynamic_rule u_dynamic_rule);

	// 修改
	@Update("UPDATE U_DYNAMIC_RULE SET USER_ID = #{user_id}, TO_UID = #{to_uid}, ADD_TIME = #{add_time}, IS_CANCEL = #{is_cancel} WHERE ID = #{id}")
	public int updateU_dynamic_rule(ApiU_dynamic_rule u_dynamic_rule);

	// 删除
	@Delete("DELETE FROM U_DYNAMIC_RULE  WHERE ID = #{id}")
	public int deleteU_dynamic_rule(Integer id);

	// Foreign keys revelant

	// region Indexs revelant

}
